using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Data;
using System.Windows;
using System.Globalization;

namespace MyPublisher.Windows.Controls.Primitives
{
    public class ReverseConverter<TBaseConverter> : IValueConverter where TBaseConverter : IValueConverter, new()
    {
        private IValueConverter _baseConverter = new TBaseConverter();

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return _baseConverter.ConvertBack(value, targetType, parameter, culture);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return _baseConverter.Convert(value, targetType, parameter, culture);
        }

        #endregion
    }
}
